//
//  ConvenientlyTakeListCell.m
//  ConvenientlyTake
//
//  Created by 张奇 on 2022/12/21.
//

#import "ConvenientlyTakeListCell.h"
#import "EventCenterModel.h"

@interface ConvenientlyTakeListCell ()

@property (weak, nonatomic) IBOutlet UIView *contentBgView;
@property (weak, nonatomic) IBOutlet UILabel *eventCodeLabel;
@property (weak, nonatomic) IBOutlet QMUILabel *stateLabel;
@property (weak, nonatomic) IBOutlet UILabel *promoterNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *eventTypeNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *originatingTimeLabel;

@end

@implementation ConvenientlyTakeListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = UIColorForBackground;
    self.contentBgView.layer.cornerRadius = TableViewCornerRadius;
    self.contentBgView.layer.masksToBounds = YES;
    
    self.stateLabel.contentEdgeInsets = UIEdgeInsetsMake(3, 6, 3, 6);
    self.stateLabel.layer.cornerRadius = 3;
    self.stateLabel.layer.masksToBounds = YES;
    
    self.stateLabel.backgroundColor = RGB(242, 243, 255);
    self.stateLabel.textColor = RGB(134, 144, 156);
    self.stateLabel.text = @"待受理";
}

- (void)setEventModel:(EventCenterModel *)eventModel {
    _eventModel = eventModel;
    self.eventCodeLabel.text = eventModel.eventCode?:@"无";
    self.stateLabel.text = eventModel.randomClapStateName?:@"无";
    self.stateLabel.textColor = eventModel.getRandomClapStateTextColor;
    self.stateLabel.backgroundColor = eventModel.getRandomClapStateBgColor;
    self.promoterNameLabel.text = [NSString stringWithFormat:@"%@(%@)", R(eventModel.promoterName), R(eventModel.promoterPhone)];
//    if (eventModel.promoterType == 2) {
//        //考察组
//        self.jobLabel.text = @"市民考察组";
//        self.jobLabelMarginRight.constant = 12;
//        self.jobLabel.hidden = NO;
//    } else {
//        //市民
//        self.jobLabel.text = @"";
//        self.jobLabelMarginRight.constant = 0;
//        self.jobLabel.hidden = YES;
//    }
    self.eventTypeNameLabel.text = eventModel.eventTypeName?:@"无";
    self.addressLabel.text = eventModel.address?:@"无";
    self.originatingTimeLabel.text = eventModel.originatingTime?:@"无";
  
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
